<?php
//sub sub
$subsubcate = SubSubCategory::model()->getAll(1);
//color
$color = Color::model()->getAll(1);
//brand
$brand = Brand::model()->getAll(1);
//size
$size = Size::model()->getAll(1);

?>

<div id="sidebar" class="fl">
            <?php if($subsubcate){?>
                <div class="box">
                    <h3 class="title">Kiểu giày</h3>
                    <div class="body">
                    <ul class="list" id="subsubcate">
                        <?php
                        foreach ($subsubcate as $key => $value) {
                            echo '<li rel="'.$value['SubSubCateId'].'"><input type="checkbox" class="o_vuong" data-label="'.$value['SubSubCateName'].'"/>';
                            echo '<span class="fr number">';
                            echo MyFunctionCustom::countProductBySubSub($value['SubSubCateId']);
                            echo '</span></li>';
                        }
                        ?>
                        </ul>
                    </div>
                </div>
                <?php }
                if($color !== null){?>
                <div class="box">
                    <h3 class="title">Màu sắc</h3>
                    <div class="body">
                        <ul class="list_ngan list" id="color">
                        <?php
                        $i = 0;
                        foreach ($color as $c => $vc) {
                            if($i%2 == 0){
                                echo '<li class="left" rel="'.$vc['ColorId'].'"><input type="checkbox" class="o_vuong" data-label="'.$vc['ColorName'].'"></li>';
                            }else{
                                echo '<li rel="'.$vc['ColorId'].'"><input type="checkbox" class="o_vuong" data-label="'.$vc['ColorName'].'"></li>';
                            }
                            $i++;
                        }
                        ?>
                        </ul>
                    </div>
                </div>
                <?php }
                 if($brand !== null){?>
                <div class="box">
                    <h3 class="title">Thương hiệu</h3>
                    <div class="body">
                        <ul class="list" id="brand">
                        <?php
                            foreach ($brand as $key => $value) { ?>
                               <li rel="<?php echo $value['BrandId'];?>">
                                    <input type="checkbox" class="o_vuong" data-label="<?php echo $value['BrandName'];?>"/></label>
                                    <span class="fr number">
                                        <?php
                                        echo MyFunctionCustom::countProductByBrand($value['BrandId']);
                                        ?>
                                    </span>
                                </li>
                        <?php
                            }
                        ?>
                            
                        </ul>
                    </div>
                </div>
                 <?php }
                 if($size !== null){?>
                <div class="box">
                    <h3 class="title">Kích thước</h3>
                    <div class="body">
                        <ul class="list_ngan list" id="size">
                        <?php
                            $ii = 0;
                            foreach ($size as $key => $value) {
                                if($ii%2 == 0){
                                    echo '<li class="left" rel="'.$value['SizeId'].'"><input type="checkbox" class="o_vuong" data-label="'.$value['SizeName'].'"/></li>';
                                }else{
                                    echo '<li rel="'.$value['SizeId'].'"><input type="checkbox" class="o_vuong" data-label="'.$value['SizeName'].'"/></li>';
                                }
                                $ii++;
                            }
                        ?>
                        </ul>
                    </div>
                </div>
                <?php
                }?>
                <div class="box">
                    <h3 class="title">Lọc theo giá</h3>
                    <div class="body">
                        <div id="slider-range"></div>
                        <div class="price">
                            <input type="text" disabled id="amountmin" value="100000" /> đến <input type="text" id="amountmax" disabled />
                        </div>
                    </div>
                </div>
                <a href="#" class="quang_cao"><img src="images/quang_cao.png" width="220" height="215"></a>
            </div>
